#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
void *t1_execute(void *arg)
{
    while (1)
        printf("in thread1\n");
}
void *t2_execute(void *arg)
{
    sleep(2);
    // pthread_exit(NULL); // 替换为 exit(0)
    exit(0);
}
void main()
{
    pthread_t pid1, pid2;
    pthread_create(&pid1, NULL, t1_execute, NULL);
    pthread_create(&pid2, NULL, t2_execute, NULL);
    pthread_join(pid1, NULL);
    pthread_join(pid2, NULL);
}